Learning Objectives

After completing this lesson, you’ll be able to:

Dataset Fanout

A dataset fanout delivers data to the same feature type but in multiple datasets. Using the elevation example again, here the output is a different dataset for each elevation value:

Dataset fanout diagram

This fanout results in a series of DXF datasets, each with one elevation’s worth of contours on one layer.

Setting a Dataset Fanout

A dataset fanout is defined in the Navigator window in Workbench, just below the writer’s dataset parameter:

Fanout Dataset parameter in the Navigator

Double-clicking the Fanout Dataset parameter opens a dialog in which a Fanout checkbox is set. Here, you can define the folder to write to and the Fanout Expression. The default values set the Fanout Directory from the destination dataset path and the Fanout Expression from the destination dataset file name:

Dataset fanout dialog

To achieve a fanout (a different file per attribute value), select an attribute to include in the file name, such as this:

Setting a Fanout Expression with an attribute

In this case, each neighborhood produces a separate file of park features.

It's important to note that the Text Editor dialog can add different components to the Fanout Directory and the Fanout Expression, including user parameters, functions, and datetimes. Generally, even if the requirement is to use an attribute to define a sub-folder, it would go into the Fanout Expression rather than the Fanout Directory.

Combining Dataset Fanout and Zip Files

Applying a fanout to a writer and zipping (compressing/archiving) the written files is easy. There are several methods for doing so.

Fanout to a Single Zip File

By setting the Destination Fanout Directory as a zip file, it's possible to write multiple fanned-out datasets to a single zip file:

Setting a fan out to a single zip file

Here, the user is fanning out to Shapefile based on the NeighborhoodName attribute. The output directory is set to a zip file, meaning the output is a single zip file with multiple datasets. Because this is Shapefile format, each dataset is a folder containing several files (.shp, .shx, and so on).

Fanout to Multiple Zip Files

Setting the Fanout Expression with a zip file extension makes it possible to write multiple fanned-out zip files, each containing a single dataset.

Creating a zipped fanout by adding .zip to the expression

Here, the user is also fanning out to Shapefile based on the NeighborhoodName attribute. The output directory is set to a plain directory, but the Fanout Expression is given a zip file extension. This leads to multiple zip files, one per dataset.

This fanout is potentially useful when the output format includes multiple files (like Shapefile format), and you wish to handle the output in some way, post-translation. It's also useful for large datasets (such as raster) where a single file can be way larger than its zipped equivalent.

Fanout to Multiple Zip Files Inside a Single Zip File

By using both of the above techniques (in other words, giving both the directory and the fanout parameters a zip file extension), you can write multiple zip files containing a single dataset into a single zip file.

Creating multiple zip files with a fanout

Here, the output is a single zip file (Training.zip) containing a series of zipped dataset files.